import request from "@/utils/request";

//查询list列表
export const getcategoryList = props => {
  return request({
    url: "/mall/admin/category/getcategoryList?search=" + props.searchkey,
    method: "get"
  });
};

//新增一级分类
export const addLevel1 = props => {
  return request({
    url: "/mall/admin/category/saveFirstCategory",
    method: "post",
    data: props
  });
};

//新增下级分类
export const saveJuniorCategory = props => {
  return request({
    url: "/mall/admin/category/saveJuniorCategory",
    method: "post",
    data: props
  });
};

//修改分类
export const saveCurrentOrJuniorCategory = props => {
  return request({
    // url: "/mall/admin/category/saveCurrentOrJuniorCategory",
    url: "/mall/admin/category/updateCurrentOrJuniorCategory",
    method: "post",
    data: props
  });
};

//删除分类
export const deleteCategory = props => {
  return request({
    url: "/mall/admin/category/deleteCategory",
    method: "delete",
    params: props
  });
};

//=======================================================================
// 待审核分类
export const pageAuditList = props => {
  return request({
    url: "/mall/admin/categoryAudit/pageList",
    method: "post",
    data: props
  });
};
// 采纳、不采纳
export const adopt = props => {
  return request({
    url: "/mall/admin/categoryAudit/adopt",
    method: "post",
    data: props
  });
};
